<?php
Yii::import ( 'littlecrm.CRMBaseController' );
class AdressController extends CRMBaseController {
	public function actionIndex() {
		$this->actionList ();
	}
	
	public function actionShow() {
		$customerId = Yii::app ()->request->getParam ( 'id', null );
		$customer = Customers::model ()->findByPk ( ( int ) $customerId );
		$this->render ( 'show', array ('customer' => $customer ) );
	}
	
	public function actionList() {
		$criteria = new CDbCriteria ();
		$pages = new CPagination ( Customers::model ()->count ( $criteria ) );
		$pages->pageSize = self::PAGE_SIZE;
		$pages->applyLimit ( $criteria );
		$customer = Customers::model ()->findAll ( $criteria );
		$this->render ( 'list', array ('customer' => $customer, 'pages' => $pages, 'dataProvider' => $dataProvider) );
	}
}